package com.fp.m7.shared.services;

import java.util.List;

import com.fp.m7.shared.ValidationResult;
import com.fp.m7.shared.dto.AccountDto;
import com.fp.m7.shared.dto.UserDto;
import com.fp.m7.shared.exception.GwtAuthenticationException;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * The client side stub for the Accounts RPC service.
 */
@RemoteServiceRelativePath("springGwtServices/accounts")
public interface AccountService extends RemoteService {

    Boolean checkUsernameAvailability(String username);

    Boolean checkNicknameAvailability(String nickname);

    ValidationResult newAccount(String username, String password, String nickname, String captchaText);

    Boolean deleteAccount() throws GwtAuthenticationException;

    Boolean changeNickname(String newNickname) throws GwtAuthenticationException;

    Boolean updateStatus(String newStatus) throws GwtAuthenticationException;

    Boolean updateDescription(String newDescription) throws GwtAuthenticationException;

    Boolean updateStatusAndDescription(String newStatus, String newDescription) throws GwtAuthenticationException;

    Boolean updateAvatarUrl(String newAvatarUrl) throws GwtAuthenticationException;

    AccountDto getDetails(String nickname);

    AccountDto getAuthenticatedAccount() throws GwtAuthenticationException;

    ValidationResult changePassword(String oldPassword, String newPassword) throws GwtAuthenticationException;

    List<UserDto> getRandomUsers(int maxCount);

}
